import 'package:base_lib/app.dart';
import 'package:base_lib/common/index.dart';
import 'package:base_lib/config.dart';
import 'package:base_lib/router/page_builder.dart';
import 'package:doctor_inquiry_lib/inquiry_plugin.dart';
import 'package:doctor_inquiry_lib/repository/https.dart';
import 'package:doctor_inquiry_lib/repository/im_http.dart';
import 'chat_list_page.dart';
import 'chat_room_c2c/chat_c2c_page.dart';

class DoctorInquiryComponent extends IComponent {
  static String assetsPackageName = "doctor_inquiry_lib";

  static String chatListPage = "$assetsPackageName/chatList";

  ///单聊页
  static String chatC2CPage = "$assetsPackageName/chatC2CPage";

  @override
  void doComponentInitConfig() {
    DoctorInquiryHttp.createHttpProxy(mBaseUrl: Config.doctorBaseUrl);
    IMHttp.createHttpProxy();
    InquiryPlugin.getInstance().initSdk();
  }

  @override
  List<EventBuilder> gePublicEvents() {
    return [];
  }

  @override
  getComponentName() {
    return "DoctorInquiryComponent";
  }

  @override
  List<PageBuilder> getPages() {
    return [
      PageBuilder(chatListPage, (parameters) {
        return ChatListPage(parameters);
      }),
      PageBuilder(chatC2CPage, (parameters) {
        return ChatC2CPage(parameters);
      }),
    ];
  }
}
